@extends('admin.layout.index')
@section('content')
<div class="mws-panel grid_8">
			<div class="mws-panel-header">
		    	<span>相册添加</span>
		    </div>
		    <div class="mws-panel-body no-padding">
		    	<form class="mws-form" action="/admin/photo/update" method="post"  enctype="multipart/form-data">
		    	<input type="hidden" name="id" value="{{$datas['id']}}">
       		<input type="hidden" name="oldpic" value="{{$datas['pic']}}">
          <input type="hidden" name="ocate" value="{{$datas['cate']}}">
		    	{{csrf_field()}}
		    		<div class="mws-form-inline">
		    		 <div class="mws-form-row">
                        <label class="mws-form-label">所属分类</label>
                        <div class="mws-form-item">
                            <select style="width:400px" name="cid">
                              <option value="0">--请选择--</option>
                               @foreach($data as $k => $v)
                              <option value="{{$v['id']}}" @if($datas['cid'] == $v['id']) selected @endif>{{$v['name']}}</option>
                              @endforeach
                           </select>
                        </div>
                    </div>
                    	<div class="mws-form-row">
                        <label class="mws-form-label">所属分类</label>
                        <div class="mws-form-item">
                            <select style="width:400px" name="cid">
                              <option value="0">--请选择--</option>
                               @foreach($cates as $k => $v)
                              <option value="{{$k}}" @if($datas['cate'] == $k) selected @endif>{{$v}}</option>
                              @endforeach
                           </select>
                        </div>
                    </div>
		    			<div class="mws-form-row">
		    				<label class="mws-form-label">相册标题</label>
		    				<div class="mws-form-item">
		    					<input class="small" type="text" name="title" value="{{$datas['title']}}">
		    				</div>
		    			</div>
		    		<div class="mws-form-row">
                    		<label class="mws-form-label">相册内容</label>
                    		<div class="mws-form-item">
							
                    		<textarea name="count" id="container" cols="30" rows="10" >
                    			  {!! $datas['count']!!}
                    		</textarea>
                    <!-- 配置文件 -->
			    <script type="text/javascript" src="/u/ueditor.config.js"></script>
			    <!-- 编辑器源码文件 -->
			    <script type="text/javascript" src="/u/ueditor.all.js"></script>
			    <!-- 实例化编辑器 -->
			    <script type="text/javascript">
			        var ue = UE.getEditor('container');
			    </script>
				</div>
            </div>


            <div class="mws-form-row">
                <label class="mws-form-label">url地址</label>
                <div class="mws-form-item">
                  <input class="small" type="text" name="url" value="{{$datas['url']}}">
              </div>
           </div>
				 <div class="mws-form-row" style="width:660px;display:inline-block">
                    <label class="mws-form-label">图片</label>
                    <div class="mws-form-item" >
                        <img src="/upload/photo/{{$datas['pic']}}" alt="" style="width:100px"><br>
                        <input type="file" name="pic" value="">
                    </div>
                </div>
                <div class="mws-form-row">
                    <label class="mws-form-label">是否禁用</label>
                     <div class="mws-form-item clearfix">
                        <ul class="mws-form-list inline">
                            <li><input type="radio" name="status" value="1" @if($datas['status'] == '1') checked @endif checked> <label>否</label></li>
                            <li><input type="radio" name="status" value="2" @if($datas['status'] == '2') checked @endif> <label>是</label></li>
                        </ul>
                    </div>
                </div>
		    		</div>
		    		<div class="mws-button-row">
		    			<input value="提交" class="btn btn-danger" type="submit">
		    			<input value="重置" class="btn " type="reset">
		    		</div>
		    	</form>
		    </div>    	
		</div>
@endsection